from fastapi import APIRouter
from fastapi.responses import JSONResponse, Response, FileResponse,PlainTextResponse
from .volume import getCurrentMasterVolume,setMasterVolume

router=APIRouter(tags=['Controller'])

@router.get('/controller/volume/set')
def set_vol(vol:int):
    after=setMasterVolume(vol)
    return PlainTextResponse(str(after))

@router.get('/controller/volume')
def get_vol():
    return PlainTextResponse(str(getCurrentMasterVolume()))
